<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Record extends CI_Controller {
	public function index() {
            if($this->session->userdata('isLoggedIn')) {
                
                $this->load->view('crm/portal',$data);                 
            }
            else {
                redirect('login');
            }
           
	}
        
        public function showAddRecordForm(){
            echo json_encode($data);
        }
        
        public function  hideAddRecordForm(){
            echo json_encode($data);
        }

        public function addRecord(){
            $recordType = $this->input->post('recordType');
            $recordInternalContact = $this->input->post('recordInternalContact');
            $recordAddedBy = $this->input->post('recordAddedBy');
            $recordAttachement = $this->input->post('recordAttachement');
            $recordDateTime = $this->input->post('recordDateTime');
            $recordContact = $this->input->post('recordContact');
            $recordDesc = $this->input->post('recordDesc');
            
            if(!$backlinkPartner || !$backlinkLink || $backlinkDesc){
                 $data['error'] = 'Please fill in all required fields.';
                echo json_encode($data);
            }
            else{
                echo json_encode($data);
            }
        }
        
}